#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int c;//electric charge
	scanf("%d", &c);
	if (c <= 150) printf("%.1lf\n", 0.4463 * c);
	else if (c > 150 && c <= 400) printf("%.1lf\n", 0.4463 * 150 + (c - 150) * 0.4663);
	else printf("%.1lf\n", 150 * 0.4463 + 250 * 0.4663 + (c - 400) * 0.5663);
	return 0;
}